home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-02 / tstrings.zip / STRINGTE.PAS < prev    next >
Pascal/Delphi Source File  |  1991-12-09  |  1KB  |  52 lines

  1. program StringTest; {Test Strings Unit}
  2.  
  3. {$X+}
  4.  
  5. Uses Objects,TStrings;
  6.  
  7. const
  8.  UpperAlpha : array [0..26] of char = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'#0;
  9.  LowerAlpha : array [0..26] of char = 'abcdefghijklmnopqrstuvwxyz'#0;
  10.  Numeric    : array [0..10]  of char = '0123456789'#0;
  11.  
  12. var
  13.  Test1 : pChar;
  14.  Test2 : pChar;
  15.  Test3 : pChar;
  16.  St1   : array [0..1024] of char;
  17.  St2   : array [0..1024] of char;
  18.  res1  : integer;
  19.  res2  : integer;
  20.  
  21. begin
  22. StrCopy(@St1[0],@UpperAlpha[0]);
  23. StrCat(@St1[0],@LowerAlpha[0]);
  24. StrCopy(@St2[0],@UpperAlpha[0]);
  25. res1:=StrComp(@St1[0],@St2[0]);
  26. res1:=StrCSpn(@UpperAlpha[0],@LowerAlpha[0]);
  27. Test1:=StrECopy(@St2[0],@UpperAlpha[0]);
  28. Test2:=StrEnd(@St2[0]);
  29. Res1:=StrIComp(@St1[0],@St2[0]);
  30. StrLCopy(@St2[0],@Numeric[0],5);
  31. Res1:=StrLComp(@St2[0],@Numeric[0],5);
  32. StrLCat(@St2[0],@Numeric[0],7);
  33. Res1:=StrLen(@St2[0]);
  34. StrlCopy(@St2[0],@LowerAlpha[0],20);
  35. Res1:=StrLIComp(@st1[0],@St2[0],15);
  36. StrLower(@St1[0]);
  37. StrUpper(@St2[0]);
  38. StrMove(@St1[0],@St2[0],15);
  39. Test2:=StrNew(@LowerAlpha[0]);
  40. WriteLn(StrPas(Test2));
  41. StrPCopy(@St2[0],'Hello World');
  42. StrCat(@St1[0],@numeric[0]);
  43. Test1:=StrPos(@St1[0],@Numeric[0]);
  44. StrCopy(@st1[0],@St2[0]);
  45. StrPCopy(@St2[0],'l');
  46. Test1:=StrRScan(@St1[0],'l');
  47. StrDispose(test2);
  48. Test2:=StrScan(@St1[0],'l');
  49. StrPCopy(@St2[0],'HELLO World');
  50. Res1:=StrSpn(@St2[0],@UpperAlpha[0]);
  51. StrUpper(@St2[0]);
  52. end.